<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<!-- 网页头部开始 -->
<nav class="navbar navbar-expand-md navbar-light bg-light fixed-top">
	<a class="navbar-brand" href="#">Logo</a>
	<button class="navbar-toggler" type="button" data-toggle="collapse"
		data-target="#navbarSupportedContent"
		aria-controls="navbarSupportedContent" aria-expanded="false"
		aria-label="Toggle navigation">
		<span class="navbar-toggler-icon"></span>
	</button>
	<div class="collapse navbar-collapse" id="navbarSupportedContent">
		<ul class="navbar-nav mr-auto">
			<li class="nav-item active">
				<a class="nav-link" href="${rootPath }">首页
					<span class="sr-only">(current)</span>
				</a>
			</li>
			<c:choose>
				<c:when test="${sessionScope.usersSess != null }">
					<!-- 已经登陆 -->
					<li class="nav-item dropdown">
						<a class="nav-link dropdown-toggle" href="#" id="navbarDropdown"
							role="button" data-toggle="dropdown" aria-haspopup="true"
							aria-expanded="false">用户管理</a>
						<div class="dropdown-menu" aria-labelledby="navbarDropdown">
							<a class="dropdown-item" href="${rootPath }/head/users/usersList">用户列表</a>
							<a class="dropdown-item" href="${rootPath }/head/users/usersUpdate">查看个人信息</a>
						</div>
					</li>
					<li class="nav-item dropdown">
						<a class="nav-link dropdown-toggle" href="#" id="navbarDropdown"
							role="button" data-toggle="dropdown" aria-haspopup="true"
							aria-expanded="false">体能管理</a>
						<div class="dropdown-menu" aria-labelledby="navbarDropdown">
							<a class="dropdown-item" href="${rootPath }/head/bodys/standsList">体能标准列表</a>
							<a class="dropdown-item" href="${rootPath }/head/bodys/sidesList">体能成绩列表</a>
							<a class="dropdown-item" href="${rootPath }/head/goods/commentList">评论列表</a>
						</div>
					</li>
					<!-- <li class="nav-item"><a class="nav-link disabled" href="#">面板</a>
					</li> -->
				</c:when>
				<c:otherwise>
					<li class="nav-item"><a class="nav-link" href="${rootPath }/login">登陆</a></li>
				</c:otherwise>
			</c:choose>
		</ul>
		<!-- 小分辨率要藏起来 -->
		<form class="form-inline my-2 my-lg-0 hidden-sm">
			<input class="form-control mr-sm-2" type="search" placeholder="关键字"
				aria-label="Search">
			<button class="btn btn-outline-success my-2 my-sm-0" type="submit">搜索</button>
		</form>
		
		<c:choose>
			<c:when test="${sessionScope.usersSess != null }">
				<ul class="navbar-nav">
					<!-- 小分辨率要藏起来 -->
					<li class="nav-item navbar-text">
						<a href="${rootPath }/head/users/main">
							<img src="${rootPath}/images/no_pic.png" 
								class="img-fluid rounded mx-auto"  width="28" height="28">
						</a>
					</li>
					<li class="nav-item dropdown">
						<a
							class="nav-link dropdown-toggle" href="#" id="navbarDropdownRight"
							role="button" data-toggle="dropdown" aria-haspopup="true"
							aria-expanded="false"> 配置 <span class="sr-only">(current)</span>
						</a>
						<div class="dropdown-menu header-right" style="margin:.125rem -5.5rem 0" aria-labelledby="navbarDropdownRight">
							<a class="dropdown-item" href="${rootPath }/head/users/usersUpdate">查看个人信息</a>
							<a class="dropdown-item" href="${rootPath }/head/users/usersUpdate?operType=updateInfo">修改个人信息</a>
							<a class="dropdown-item" href="${rootPath }/head/users/usersUpdate?operType=updatePhoto">修改头像</a>
							<a class="dropdown-item" href="${rootPath }/head/users/usersUpdate?operType=updatePass">修改密码</a>
							<div class="dropdown-divider"></div>
							<a class="dropdown-item" href="#" data-toggle="modal" data-target="#logoutModal">退出</a>
						</div>
					</li>
				</ul>
			</c:when>
			<c:otherwise>
				<ul class="navbar-nav">
					<!-- 小分辨率要藏起来 -->
					<li class="nav-item"><a class="nav-link" href="${rootPath }/login.htm">登陆</a></li>
					<li class="nav-item"><a class="nav-link" href="${rootPath }/register.htm">注册</a></li>
				</ul>
			</c:otherwise>
		</c:choose>
	</div>
</nav>
<!-- 退出登陆的对话框 -->
<div class="modal fade" id="logoutModal" tabindex="-1" role="dialog"
	aria-labelledby="exampleModalLabel" aria-hidden="true">
	<div class="modal-dialog" role="document">
		<div class="modal-content">
			<div class="modal-header">
				<h5 class="modal-title" id="exampleModalLabel">提示信息</h5>
				<button type="button" class="close" data-dismiss="modal"
					aria-label="Close">
					<span aria-hidden="true">&times;</span>
				</button>
			</div>
			<div class="modal-body">
				确认要退出吗? 
			</div>
			<div class="modal-footer">
				<button type="button" class="btn btn-secondary" data-dismiss="modal">关闭</button>
				<a class="btn btn-primary" href="${rootPath }/head/users/logout">退出</a>
			</div>
		</div>
	</div>
</div>